import { WsEventType } from '../../domain/events/ws.events';

export interface WSMessage {
  type: WsEventType;
  payload?: {
    chatId?: string;
    messageId?: string;
    message?: {
      id?: string;
      content?: string;
      sender?: string;
      time?: string;
    };
    status?: string;
    statusText?: string;
    timestamp?: string;
    messages?: Array<{
      id: string;
      type: string;
      sender: string;
      content: string;
      time: string;
    }>;
    sender?: string;
    isTyping?: boolean;
    // Authentication and registration properties
    username?: string;
    password?: string;
    email?: string;
    token?: string;
    user?: any;
    accessToken?: string;
    refreshToken?: string;
    error?: string;
  };
  timestamp?: number;
  // 兼容旧格式
  sessionId?: string;
  senderId?: string;
  content?: string;
}